package main

import "fmt"

func main() {
	var a = sum
	var result = calc(a, 1, 2)
	fmt.Println(result)
}

//函数作为形参
func calc(fun func(int, int) int, num1 int, num2 int) int {
	return fun(num1, num2)
}

func sum(a int, b int) int {
	return a + b
}
